/**
 * Collapse 组件的主题配置
 * 
 * 基于企业级设计规范 (Collapse.json) 的完整配置
 * 折叠面板组件样式定义
 */

import type { ComponentToken } from 'antd/es/collapse/style';

// ========== 设计 Token 常量 ==========

/**
 * 头部相关 Token
 */
const HEADER_TOKENS = {
  headerPadding: '12px 16px',
  headerBg: '#fafafa',
} as const;

/**
 * 内容相关 Token
 */
const CONTENT_TOKENS = {
  contentPadding: '16px 16px',
  contentBg: '#ffffff',
  borderlessContentPadding: '4px 16px 16px',
  borderlessContentBg: 'transparent',
} as const;

/**
 * Collapse 完整主题配置
 */
export const collapseThemeConfig: Partial<ComponentToken> = {
  // ========== 头部配置 ==========
  headerPadding: HEADER_TOKENS.headerPadding as any,
  headerBg: HEADER_TOKENS.headerBg,

  // ========== 内容配置 ==========
  contentPadding: CONTENT_TOKENS.contentPadding as any,
  contentBg: CONTENT_TOKENS.contentBg,
  borderlessContentPadding: CONTENT_TOKENS.borderlessContentPadding as any,
  borderlessContentBg: CONTENT_TOKENS.borderlessContentBg,
};

export const getCollapseTheme = (
  customConfig?: Partial<ComponentToken>
): Partial<ComponentToken> => {
  return {
    ...collapseThemeConfig,
    ...customConfig,
  };
};

export type { ComponentToken as CollapseComponentToken } from 'antd/es/collapse/style';

